import useDayjsHelper from '../useDayjsHelper'

function useElementHelper() {
    const { getMonthRange, getWeekRange } = useDayjsHelper()

    const dateShortcuts = [
        {
            text: '最近一周',
            value: () => {
                const [start, end] = getWeekRange(1)
                return [start, end]
            },
        },
        {
            text: '最近一个月',
            value: () => {
                const [start, end] = getMonthRange(1)
                return [start, end]
            },
        },
        {
            text: '最近三个月',
            value: () => {
                const [start, end] = getMonthRange(3)
                return [start, end]
            },
        },
        {
            text: '最近六个月',
            value: () => {
                const [start, end] = getMonthRange(6)
                return [start, end]
            },
        },
        {
            text: '最近一年',
            value: () => {
                const [start, end] = getMonthRange(12)
                return [start, end]
            },
        },
    ]

    return {
        dateShortcuts,
    }
}

export default useElementHelper
